function css_browser_selector(a){var d=a.toLowerCase(),e=function(a){return-1"),this.$.wrap(this.$div).before(this.$c),this.$div=this.$.parent(),"undefined"!=typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(this.$c[0]),this.c=this.$c[0].getContext?this.$c[0].getContext("2d"):null,!this.c)throw{name:"CanvasNotSupportedException",message:"Canvas not supported. Please use excanvas on IE8.0.",toString:function(){return this.name+": "+this.message}};return this.scale=(window.devicePixelRatio||1)/(this.c.webkitBackingStorePixelRatio||this.c.mozBackingStorePixelRatio||this.c.msBackingStorePixelRatio||this.c.oBackingStorePixelRatio||this.c.backingStorePixelRatio||1),this.relativeWidth=0!=this.o.width%1&&this.o.width.indexOf("%"),this.relativeHeight=0!=this.o.height%1&&this.o.height.indexOf("%"),this.relative=this.relativeWidth||this.relativeHeight,this._carve(),this.v instanceof Object?(this.cv={},this.copy(this.v,this.cv)):this.cv=this.v,this.$.bind("configure",b).parent().bind("configure",b),this._listen()._configure()._xy().init(),this.isInit=!0,this.$.val(this.o.format(this.v)),this._draw(),this}},this._carve=function(){if(this.relative){var a=this.relativeWidth?this.$div.parent().width()*parseInt(this.o.width)/100:this.$div.parent().width(),b=this.relativeHeight?this.$div.parent().height()*parseInt(this.o.height)/100:this.$div.parent().height();this.w=this.h=Math.min(a,b)}else this.w=this.o.width,this.h=this.o.height;return this.$div.css({width:this.w+"px",height:this.h+"px"}),this.$c.attr({width:this.w,height:this.h}),1!==this.scale&&(this.$c[0].width*=this.scale,this.$c[0].height*=this.scale,this.$c.width(this.w),this.$c.height(this.h)),this},this._draw=function(){var a=!0;f.g=f.c,f.clear(),f.dH&&(a=f.dH()),!1!==a&&f.draw()},this._touch=function(a){var d=function(a){var b=f.xy2val(a.originalEvent.touches[f.t].pageX,a.originalEvent.touches[f.t].pageY);b==f.cv||f.cH&&!1===f.cH(b)||(f.change(f._validate(b)),f._draw())};return this.t=b.c.t(a),d(a),b.c.d.bind("touchmove.k",d).bind("touchend.k",function(){b.c.d.unbind("touchmove.k touchend.k"),f.val(f.cv)}),this},this._mouse=function(a){var d=function(a){var b=f.xy2val(a.pageX,a.pageY);b==f.cv||f.cH&&!1===f.cH(b)||(f.change(f._validate(b)),f._draw())};return d(a),b.c.d.bind("mousemove.k",d).bind("keyup.k",function(a){if(27===a.keyCode){if(b.c.d.unbind("mouseup.k mousemove.k keyup.k"),f.eH&&!1===f.eH())return;f.cancel()}}).bind("mouseup.k",function(){b.c.d.unbind("mousemove.k mouseup.k keyup.k"),f.val(f.cv)}),this},this._xy=function(){var a=this.$c.offset();return this.x=a.left,this.y=a.top,this},this._listen=function(){return this.o.readOnly?this.$.attr("readonly","readonly"):(this.$c.bind("mousedown",function(a){a.preventDefault(),f._xy()._mouse(a)}).bind("touchstart",function(a){a.preventDefault(),f._xy()._touch(a)}),this.listen()),this.relative&&a(window).resize(function(){f._carve().init(),f._draw()}),this},this._configure=function(){return this.o.draw&&(this.dH=this.o.draw),this.o.change&&(this.cH=this.o.change),this.o.cancel&&(this.eH=this.o.cancel),this.o.release&&(this.rH=this.o.release),this.o.displayPrevious?(this.pColor=this.h2rgba(this.o.fgColor,"0.4"),this.fgColor=this.h2rgba(this.o.fgColor,"0.6")):this.fgColor=this.o.fgColor,this},this._clear=function(){this.$c[0].width=this.$c[0].width},this._validate=function(a){var b=~~((0>a?-.5:.5)+a/this.o.step)*this.o.step;return Math.round(100*b)/100},this.listen=function(){},this.extend=function(){},this.init=function(){},this.change=function(){},this.val=function(){},this.xy2val=function(){},this.draw=function(){},this.clear=function(){this._clear()},this.h2rgba=function(b,d){var a;return b=b.substring(1,7),a=[parseInt(b.substring(0,2),16),parseInt(b.substring(2,4),16),parseInt(b.substring(4,6),16)],"rgba("+a[0]+","+a[1]+","+a[2]+","+d+")"},this.copy=function(a,b){for(var d in a)b[d]=a[d]}},b.Dial=function(){b.o.call(this),this.startAngle=null,this.xy=null,this.radius=null,this.lineWidth=null,this.cursorExt=null,this.w2=null,this.PI2=2*Math.PI,this.extend=function(){this.o=a.extend({bgColor:this.$.data("bgcolor")||"#EEEEEE",angleOffset:this.$.data("angleoffset")||0,angleArc:this.$.data("anglearc")||360,inline:!0},this.o)},this.val=function(a,b){if(null!=a){if(a=this.o.parse(a),!1!==b&&a!=this.v&&this.rH&&!1===this.rH(a))return;this.cv=this.o.stopper?d(f(a,this.o.max),this.o.min):a,this.v=this.cv,this.$.val(this.o.format(this.v)),this._draw()}else return this.v},this.xy2val=function(b,e){var g,h;return g=Math.atan2(b-(this.x+this.w2),-(e-this.y-this.w2))-this.angleOffset,this.o.flip&&(g=this.angleArc-g-this.PI2),this.angleArc!=this.PI2&&0>g&&-.5g&&(g+=this.PI2),h=g*(this.o.max-this.o.min)/this.angleArc+this.o.min,this.o.stopper&&(h=d(f(h,this.o.max),this.o.min)),h},this.listen=function(){var b,g,h,i,j=this,e=function(a){a.preventDefault();var e=a.originalEvent,h=e.detail||e.wheelDeltaX,i=e.detail||e.wheelDeltaY,k=j._validate(j.o.parse(j.$.val()))+(0h||0>i?-j.o.step:0);k=d(f(k,j.o.max),j.o.min),j.val(k,!1),j.rH&&(clearTimeout(b),b=setTimeout(function(){j.rH(k),b=null},100),!g&&(g=setTimeout(function(){b&&j.rH(k),g=null},200)))},k=1,l={37:-j.o.step,38:j.o.step,39:j.o.step,40:-j.o.step};this.$.bind("keydown",function(b){var e=b.keyCode;if(96<=e&&105>=e&&(e=b.keyCode=e-48),h=parseInt(String.fromCharCode(e)),isNaN(h)&&(13!==e&&8!==e&&9!==e&&189!==e&&(190!==e||j.$.val().match(/\./))&&b.preventDefault(),-1j.o.max&&j.$.val(j.o.max)||j.$.val()this.o.max)&&(this.v=this.o.min),this.$.val(this.v),this.w2=this.w/2,this.cursorExt=this.o.cursor/100,this.xy=this.w2*this.scale,this.lineWidth=this.xy*this.o.thickness,this.lineCap=this.o.lineCap,this.radius=this.xy-this.lineWidth/2,this.o.angleOffset&&(this.o.angleOffset=isNaN(this.o.angleOffset)?0:this.o.angleOffset),this.o.angleArc&&(this.o.angleArc=isNaN(this.o.angleArc)?this.PI2:this.o.angleArc),this.angleOffset=this.o.angleOffset*Math.PI/180,this.angleArc=this.o.angleArc*Math.PI/180,this.startAngle=1.5*Math.PI+this.angleOffset,this.endAngle=1.5*Math.PI+this.angleOffset+this.angleArc;var a=d((Math.abs(this.o.max)+"").length,(Math.abs(this.o.min)+"").length,2)+2;this.o.displayInput&&this.i.css({width:(this.w/2+4>>0)+"px",height:(this.w/3>>0)+"px",position:"absolute","vertical-align":"middle","margin-top":(this.w/3>>0)+"px","margin-left":"-"+(3*this.w/4+2>>0)+"px",border:0,background:"none",font:this.o.fontWeight+" "+(this.w/a>>0)+"px "+this.o.font,"text-align":"center",color:this.o.inputColor||this.o.fgColor,padding:"0px","-webkit-appearance":"none"})||this.i.css({width:"0px",visibility:"hidden"})},this.change=function(a){this.cv=a,this.$.val(this.o.format(a))},this.angle=function(a){return(a-this.o.min)*this.angleArc/(this.o.max-this.o.min)},this.arc=function(a){var b,d;return a=this.angle(a),this.o.flip?(b=this.endAngle+1e-5,d=b-a-1e-5):(b=this.startAngle-1e-5,d=b+a+1e-5),this.o.cursor&&(b=d-this.cursorExt)&&(d+=this.cursorExt),{s:b,e:d,d:this.o.flip&&!this.o.cursor}},this.draw=function(){var b,d=this.g,e=this.arc(this.cv),a=1;d.lineWidth=this.lineWidth,d.lineCap=this.lineCap,"none"!==this.o.bgColor&&(d.beginPath(),d.strokeStyle=this.o.bgColor,d.arc(this.xy,this.xy,this.radius,this.endAngle-1e-5,this.startAngle+1e-5,!0),d.stroke()),this.o.displayPrevious&&(b=this.arc(this.v),d.beginPath(),d.strokeStyle=this.pColor,d.arc(this.xy,this.xy,this.radius,b.s,b.e,b.d),d.stroke(),a=this.cv==this.v),d.beginPath(),d.strokeStyle=a?this.o.fgColor:this.fgColor,d.arc(this.xy,this.xy,this.radius,e.s,e.e,e.d),d.stroke()},this.cancel=function(){this.val(this.v)}},a.fn.dial=a.fn.knob=function(e){return this.each(function(){var f=new b.Dial;f.o=e,f.$=a(this),f.run()}).parent()}});